//
//  WDMineFooterView.m
//  wd-serviceapp
//
//  Created by Bin Tang on 2024/8/16.
//

#import "WDMineFooterView.h"

@interface WDMineFooterView ()

/// 退出登录
@property (nonatomic, strong) UIButton *btnLogout;
@end

@implementation WDMineFooterView

- (void)initWithSubView {
    [super initWithSubView];
    
    [self initWithBtnLogout];
}

- (void)initWithBtnLogout {
    if (!_btnLogout) {
        CGRect frame = CGRectMake(20, self.height - 50 - 20, self.width - 40, 50);
        _btnLogout = [UIButton createWithButton:self frame:frame font:[UIFont systemFontOfSize:14 weight:UIFontWeightRegular] target:self action:@selector(actionWithLogout:) propertiesBlock:^(UIButton * _Nonnull button) {
            [button setTitle:@"退出登录" forState:UIControlStateNormal];
            [button setTitleColor:[UIColor colorWithHexString:@"#ffffff"] forState:UIControlStateNormal];
            button.backgroundColor = [UIColor colorWithHexString:@"#19C46E"];
            button.layer.cornerRadius = 5;
            button.layer.masksToBounds = YES;
        }];
    }
}

- (void)actionWithLogout:(id)sender {
    if (self.viewBlock) {
        self.viewBlock(nil);
    }
}

@end
